var ExtTree = {};

ExtTree.tree = {
	createTree:function(id,reader,loader,defalutChild){
		var treeLoader = new Ext.tree.TreeLoader({
			dataUrl : loader
		}); 
		
		treeLoader.on('beforeload',function(treeLoader, node) {
			treeLoader.baseParams = {
			    pid: ""+node.id,
		        date: new Date()
		    };
		}, treeLoader); 
		
		new Ext.tree.TreePanel({
			id:id,
			renderTo: reader,
			animate:true,
			border:false,
			collapsible:false,
			rootVisible:false,
			autoScroll:false,
			autoHeight:true, 
			root: new Ext.tree.AsyncTreeNode({
				expanded: true,
				loader:treeLoader,
				children: [{id:'3',text:'我的工作台',href:'',checked:false,leaf:false},{id:'4',text:'我的工作台w',href:'',checked:false,leaf:false},{id:'5',text:'我的工作台2',href:'',checked:false,leaf:false},{id:'6',text:'我的工作台4',href:'',checked:false,leaf:false},{id:'7',text:'我的工作台1',href:'',checked:false,leaf:false}]
			}),
			listeners:{click:function(node,event){
		   		event.stopEvent(); 
		   		if (node.leaf==true) {  
		   		   	
		        }  
		   	}}
		});	  //new Ext.tree.TreePan
	}
}();